package cn.liujing.controller;

import cn.liujing.entity.CommonResult;
import cn.liujing.entity.Payment;
import cn.liujing.service.PaymentService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class controller {
    @Resource
    private PaymentService paymentService;
    @Value("${server.port}")
    private String port;
    @GetMapping("/payment/getpaymentbyId/{id}")
    public CommonResult getPaymentById(@PathVariable("id") int id){
        Payment payment=paymentService.getPaymentById(id);
        return new CommonResult(200,port,payment);
    }
}
